import Vue from 'vue'
import Vuex from 'vuex'
import createLogger from 'vuex/dist/logger'
import { createPersistedState, createSharedMutations } from 'vuex-electron'

import modules from './modules'
import { EBUSY } from 'constants';
import { type } from 'os';

Vue.use(Vuex)

export default new Vuex.Store({
  modules,
  state: {
    is_init: false,
    remote_ip: '0.0.0.0'
  },

  mutations: {
    isInited(state, inited) {
      state.is_init = inited
    },

    update_remote_ip(state, ip) {
      state.remote_ip = ip
    }
  },

  plugins: [
    createLogger()
    // createPersistedState(),
    // createSharedMutations()
  ],
  strict: process.env.NODE_ENV !== 'production'
})
